import { BrowserModule } from "@angular/platform-browser";
import { NgModule } from "@angular/core";

import { AppRoutingModule } from "./app-routing.module";
import { AppComponent } from "./app.component";
import { FormsModule } from "@angular/forms";
import { HttpClientModule } from "@angular/common/http";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { NZ_I18N } from "ng-zorro-antd/i18n";
import { zh_CN } from "ng-zorro-antd/i18n";
import {
  registerLocaleData,
  HashLocationStrategy,
  LocationStrategy,
} from "@angular/common";
import zh from "@angular/common/locales/zh";
import { Pl00EditorComponent } from "./pl00-editor/pl00-editor.component";
import { MonacoEditorModule } from "ngx-monaco-editor";

import { NgZorroAntdModule } from "ng-zorro-antd";
import { Pl00EditorPageComponent } from "./pl00-editor-page/pl00-editor-page.component";
import monacoConfig from "./monaco.config";
import { Pl00ConsoleComponent } from "./pl00-console/pl00-console.component";
import { Pl00ProblemsPanelComponent } from "./pl00-problems-panel/pl00-problems-panel.component";
import { MathModule } from "./math/math.module";
import { NzIconModule } from "ng-zorro-antd/icon";
import { IconDefinition } from "@ant-design/icons-angular";
import {
  FolderOutline,
  SettingOutline,
  SnippetsOutline,
} from "@ant-design/icons-angular/icons";

registerLocaleData(zh);
const icons: IconDefinition[] = [
  FolderOutline,
  SettingOutline,
  SnippetsOutline,
];

@NgModule({
  declarations: [
    AppComponent,
    Pl00EditorComponent,
    Pl00EditorPageComponent,
    Pl00ConsoleComponent,
    Pl00ProblemsPanelComponent,
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    FormsModule,
    HttpClientModule,
    BrowserAnimationsModule,
    MonacoEditorModule.forRoot(monacoConfig),
    NgZorroAntdModule,
    NzIconModule.forRoot(icons),
    MathModule.forRoot(),
  ],
  providers: [
    { provide: NZ_I18N, useValue: zh_CN },
    { provide: LocationStrategy, useClass: HashLocationStrategy },
  ],
  bootstrap: [AppComponent],
})
export class AppModule {}
